j3deditor.bin.hierarchy.util
Class ProjectSaver

java.lang.Object
  extended by javax.swing.SwingWorker<java.lang.Void,java.lang.Void>
      extended by j3deditor.bin.hierarchy.util.HierarchyWorker
          extended by j3deditor.bin.hierarchy.util.ProjectSaver
All Implemented Interfaces:
java.lang.Runnable, java.util.concurrent.Future<java.lang.Void>, java.util.concurrent.RunnableFuture<java.lang.Void>

public class ProjectSaver
extends HierarchyWorker

Tool for saving scenes. Uses com.sun.j3d.utils.scenegraph.io.SceneGraphStreamWriter to save BranchGroup.

Author:
Risto Seene
See Also:
SceneGraphStreamWriter

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.SwingWorker
javax.swing.SwingWorker.StateValue
 
Constructor Summary
ProjectSaver(J3DeScene scene)
          Creates an instance of ProjectSaver which is able to save BranchGroup from the given scene.
 
Method Summary
protected  java.lang.Void doInBackground()
          Performs the saving process in a background thread.
protected  void done()
          Notifies all listeners that object(s) have been altered.
 void saveProject(java.lang.String filePath)
          Saves the scene to the given file.
 
Methods inherited from class j3deditor.bin.hierarchy.util.HierarchyWorker
addHierarchyListener, notifyListeners, removeHierarchyListener
 
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectSaver

public ProjectSaver(J3DeScene scene)
Creates an instance of ProjectSaver which is able to save BranchGroup from the given scene.

Parameters:
scene - an instance of J3DeScene this loader can save from
Method Detail

saveProject

public void saveProject(java.lang.String filePath)
Saves the scene to the given file.

Parameters:
filePath - path of the file the scene will be saved to

doInBackground

protected java.lang.Void doInBackground()
                                 throws java.lang.Exception
Performs the saving process in a background thread.

Overrides:
doInBackground in class HierarchyWorker
Returns:
nothing
Throws:
java.lang.Exception - if an error occurs
See Also:
SwingWorker.doInBackground()

done

protected void done()
Notifies all listeners that object(s) have been altered.

Overrides:
done in class javax.swing.SwingWorker<java.lang.Void,java.lang.Void>